<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            background-image: url("{{ url_for('static', filename='images/bg2.2.png') }}"); /* 修复语法错误 */
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }
        .login-container {
            background-color: rgba(255, 255, 255, 0.8); /* 半透明效果 */
            backdrop-filter: blur(10px); /* 毛玻璃效果 */
            background-color: #fff;
            padding: 35px;
            border-radius: 10px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            width: 450px;
            text-align: center;
        }
        .login-container h2 {
            margin-bottom: 15px;
            color: #333;
        }
        .login-container input {
            width: 100%;
            padding: 10px;
            margin: 8px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
        }
        .login-container button {
            margin-top: 15px;
            width: 100%;
            padding: 10px;
            background-color: #007BFF;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .login-container button:hover {
            background-color: #0056b3;
        }
        .error-message {
            color: red;
            margin-bottom: 10px;
        }
        .register-link {
            margin-top: 15px;
        }
        .register-link a {
            color: #007BFF;
            text-decoration: none;
        }
        .register-link a:hover {
            text-decoration: underline;
        }
        .header-image {
            text-align: center;
            margin-bottom: -20px;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="header-image">
        <img src="{{ url_for('static', filename='/images/libImgHeader.png') }}" alt="Header Image"
             style="max-width: 100%; height: auto;">
    </div>
    <h2>欢迎登录</h2>
    {% if error %}
    <div class="error-message">{{ error }}</div>
    {% endif %}
    <form method="post">
        <input type="text" name="username" placeholder="用户名" required>
        <input type="password" name="password" placeholder="密码" required>
        <button type="submit">登录</button>
    </form>
    <div class="register-link">
        没有账号？<a href="{{ url_for('register') }}">立即注册</a>
    </div>
</div>
</body>
</html>